const mongoose =require("mongoose")

//创建一个约束对象
const advSchema = new mongoose.Schema({
    advTitle: {
        type: String,
        required: true
    },
    //广告类型
    advType: {
        type: Number,
        required: true
    },
    //广告排序
    advOrder: {
        type: Number,
        required: true
    },
    //图片地址
    advHref: {
        type: String,
        required: true,
    },
    //添加时间
    addTime: {
        type: String,
        required: true,
    },
    //更新时间
    upTime: {
        type: String,
        required: true,
        default: "--"
    }
});

//3.根据某个约束对象,去创建某个集合
const advModel = mongoose.model("advList", advSchema);

module.exports = advModel;